let myHeading = document.querySelector('h1');
myHeading.textContent = 'Hello world!';

let myName = 'hg'

function add(x, y) {
    return x + y
}

console.log(add(1, 2))

document.onclick = function () {
    console.log('别戳我，我怕疼。');
}


let button = document.getElementById('button')
let input = document.getElementById('input')

button.onclick = function () {
    input.setAttribute('type', 'radio')
}

let button1 = document.getElementById('button1')

function updateName() {
    let name = prompt('输入一个新的名字：');
    document.getElementById('p').textContent = '玩家1：' + name;
}
button1.onclick = updateName()
